home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / remdevice.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  77 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: remdevice.c,v 1.4 1996/08/13 13:56:06 digulla Exp $
  4.     $Log: remdevice.c,v $
  5.     Revision 1.4  1996/08/13 13:56:06  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:16  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/devices.h>
  17. #include <exec/execbase.h>
  18. #include <aros/libcall.h>
  19. #include <dos/dos.h>
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.     #include <clib/exec_protos.h>
  25.  
  26.     __AROS_LH1(void, RemDevice,
  27.  
  28. /*  SYNOPSIS */
  29.     __AROS_LHA(struct Device *, device,A1),
  30.  
  31. /*  LOCATION */
  32.     struct ExecBase *, SysBase, 73, Exec)
  33.  
  34. /*  FUNCTION
  35.     Calls the given device's expunge vector, thus trying to delete it.
  36.     The device may refuse to do so and still be open after this call.
  37.  
  38.     INPUTS
  39.     device - Pointer to the device structure.
  40.  
  41.     RESULT
  42.  
  43.     NOTES
  44.  
  45.     EXAMPLE
  46.  
  47.     BUGS
  48.  
  49.     SEE ALSO
  50.     AddDevice(), OpenDevice(), CloseDevice().
  51.  
  52.     INTERNALS
  53.  
  54.     HISTORY
  55.  
  56. ******************************************************************************/
  57. {
  58.     __AROS_FUNC_INIT
  59.  
  60.     /* Arbitrate for the device list */
  61.     Forbid();
  62.  
  63.     /* Call expunge vector */
  64.     (void)__AROS_LVO_CALL0(BPTR,3,device);
  65.     /*
  66.     Normally you'd expect the device to be expunged if this returns
  67.     non-zero, but this is only exec which doesn't know anything about
  68.     seglists - therefore dos.library has to SetFunction() into this
  69.     vector for the additional functionality.
  70.     */
  71.  
  72.     /* All done. */
  73.     Permit();
  74.     __AROS_FUNC_EXIT
  75. } /* RemDevice */
  76.  
  77.